package com.tl.web.controller.api;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tl.app.domain.AppGift;
import com.tl.app.service.IAppGiftService;
import com.tl.app.service.IAppGiftUserService;
import com.tl.common.core.controller.BaseController;
import com.tl.common.core.domain.AjaxResult;

/**
 * 
 * @author 15110
 *
 */
@RestController
@RequestMapping("/api/gift")
public class ApiGiftController extends BaseController{
	
	
	@Autowired
	private IAppGiftService appGiftService;
	
	@Autowired
	private IAppGiftUserService appGiftUserService;

    /**
     * 查询礼物列表
     */
    @GetMapping("/list")
    public AjaxResult list(AppGift appGift){
    	appGift.setStatus("0");
        List<AppGift> list = appGiftService.selectAppGiftList(appGift);
        return AjaxResult.success(list);
    }
	
    
    /**
     * 获取店员礼物墙
     */
    @GetMapping("/getUserGiftList")
    public AjaxResult getUserGiftList(){
    	Map<String, Object> map = appGiftUserService.selectAppGiftUserByClerkInfo(getUserId(),"user");
    	return AjaxResult.success(map);
    }
	

}
